package com.ep.thirdPlatformProject.system.entity;


import com.baomidou.mybatisplus.annotation.*;
import lombok.Builder;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.lang.reflect.Field;
import java.util.Date;

@Builder
@Data
@TableName("oa_sync_record")
public class SyncOARecordEntity {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * emp没有
     */
    private String empNo;

    /**
     * emp名字
     */
    private String empName;

    /**
     * ip地址
     */
    private String ipAddress;

    /**
     * 表单id
     */
    private Integer formId;


    /**
     * 表单名称
     */
    private String formName;


    /**
     * 是否成功
     */
    private Boolean isSuccess;


    /**
     * 记录数据
     */
    private String recordData;


    /**
     * 请求参数
     */
    private String params;


    /**
     * 方法名称
     */
    private String methodName;


    /**
     * 创造时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


    @Override
    public String toString() {
        ToStringBuilder builder = new ToStringBuilder(this);
        Field[] fields = this.getClass().getDeclaredFields();
        try {
            for (Field f : fields) {
                f.setAccessible(true);
                builder.append(f.getName(), f.get(this)).append("\n");
            }
        } catch (Exception e) {
            builder.append("toString builder encounter an error");
        }
        return builder.toString();
    }

}
